﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using CamDo.DAO;

namespace CamDo
{
    public partial class frmMain : DevComponents.DotNetBar.Office2007RibbonForm
    {
        private DataTable data;
        public frmMain()
        {
            InitializeComponent();
        }
        private void ribbonBar7_ItemClick(object sender, EventArgs e)
        {

        }

        private void tabStrip1_SelectedTabChanged(object sender, TabStripTabChangedEventArgs e)
        {

        }

       

        private void frmMain_Load(object sender, EventArgs e)
        {
            frmDangNhap childform = new frmDangNhap();
            childform.ShowDialog(this);

        }

        private void listProduct_Click(object sender, EventArgs e)
        {
            frmList list = new frmList();
            list.MdiParent = this;
            list.Dock = DockStyle.Fill;
            CamDoDAO camdoDao = new CamDoDAO();
            list.setDataSource(camdoDao.getAllData());
           // MessageBox.Show(camdoDao.Error);
            
            list.Show();
        }

        private void frmMain_Load_1(object sender, EventArgs e)
        {

        }

        private void addProduct_Click(object sender, EventArgs e)
        {
            frmAdd addObj = new frmAdd();
            addObj.MdiParent = this;
            addObj.setTitleLabel("THÊM MỚI MẶT HÀNG CẦM ĐỒ");
            addObj.Dock = DockStyle.Fill;
            addObj.Show();
        }

        private void ribbonBar2_ItemClick(object sender, EventArgs e)
        {

        }

        private void buttonItem14_Click(object sender, EventArgs e)
        {
            frmDanhMuc frmDM = new frmDanhMuc();
            frmDM.MdiParent = this;
            frmDM.Dock = DockStyle.Fill;
            frmDM.Show();
        }

        private void buttonItem8_Click(object sender, EventArgs e)
        {
            frmList list = new frmList();
            list.MdiParent = this;
            list.Dock = DockStyle.Fill;
            list.Edit = true;
            CamDoDAO camdoDao = new CamDoDAO();
            list.setDataSource(camdoDao.getAllData());
            // MessageBox.Show(camdoDao.Error);

            list.Show();
        }
        //update hang cam do
        private void buttonItem9_Click(object sender, EventArgs e)
        {
            frmList list = new frmList();
            list.MdiParent = this;
            list.Dock = DockStyle.Fill;
            list.Delete = true;
            CamDoDAO camdoDao = new CamDoDAO();
            list.setDataSource(camdoDao.getAllData());
            // MessageBox.Show(camdoDao.Error);

            list.Show();
        }
        //delete hang cam do
        private void buttonItem10_Click(object sender, EventArgs e)
        {
            frmList list = new frmList();
            list.MdiParent = this;
            list.Dock = DockStyle.Fill;
            list.ChuocDo = true;
            CamDoDAO camdoDao = new CamDoDAO();
            list.setDataSource(camdoDao.getAllData());
            // MessageBox.Show(camdoDao.Error);

            list.Show();
        }
        //gia han cam do
        private void buttonItem11_Click(object sender, EventArgs e)
        {
            frmGiaHan formGiaHan = new frmGiaHan();
            formGiaHan.MdiParent =this;
            formGiaHan.Dock = DockStyle.Fill;
            
            formGiaHan.Show();
        }

        private void buttonItem15_Click(object sender, EventArgs e)
        {
            frmTimKiem formTimKiem = new frmTimKiem();
            formTimKiem.MdiParent = this;
            formTimKiem.Dock = DockStyle.Fill;
            formTimKiem.Show();
        }

        private void buttonItem1_Click(object sender, EventArgs e)
        {
            frmMuaHang formMuaHang = new frmMuaHang();
            formMuaHang.MdiParent = this;
            formMuaHang.Dock = DockStyle.Fill;
            formMuaHang.Show();
        }

        private void btnSales_Click(object sender, EventArgs e)
        {
            frmBanHang formBanHang = new frmBanHang();
            formBanHang.MdiParent = this;
            formBanHang.Dock = DockStyle.Fill;
            formBanHang.Show();
        }

        private void ribbonControl1_Click(object sender, EventArgs e)
        {

        }

        private void buttonItem2_Click(object sender, EventArgs e)
        {

        }

        private void Thoát_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void buttonItem3_Click(object sender, EventArgs e)
        {
            
            frmDangNhap frmdangnhap = new frmDangNhap();

            frmdangnhap.Show();
        }

        private void buttonItem2_Click_1(object sender, EventArgs e)
        {

        }

    }
}